﻿using System;
using Microsoft.AspNetCore.Mvc;
using web01.Service;
using web01.Service.ServiceImpl;

namespace web01.Controllers
{

    public class MyController : Controller
    {
        private  IMyService Iservice ;
        private MyDbContext MyDbContext;
        public MyController(IMyService iservice, MyDbContext myDbContext)
        {
            Iservice = iservice;
            MyDbContext = myDbContext;
        }
        // GET
        
        public IActionResult Index()
        {
            var userName = Iservice.getUserName(1);
            ViewBag.userName = userName;
            var hashCode = Iservice.GetHashCode();
            ViewBag.GetHashCode = hashCode;
            ViewBag.hash = this.GetHashCode();
            return View();
        }
    }
}